<?php echo $this->render('inc/header.htm') ?>
	<!-- Page content -->
	<div id="page">
		<!-- Wrapper -->
		<div class="wrapper">
			<!-- left column/section -->
			<?php echo $this->render('inc/_left_nav.htm') ?>
			<!-- End of left column/section -->
				
			<!-- right column/section -->
			<section class="column width6 right_content">
				
				<div class="colgroup leading">
					<div class="width3 system_info">
						<h4>页头导航管理:</h4>
						<hr/>
						<table class="no-style full">
							<tbody>
								<tr>
									<td><strong>排序编号</strong></td>
									<td><strong width="240">导航小图标 20 x 20px</strong></td>
									<td width="120"><strong>导航名称</strong></td>
									<td><strong>导航URL地址</strong></td>
									<td><strong>操作</strong></td>
								</tr>
							</tbody>
							<tbody>
								<?php foreach($this->rslist as $k=>$v){?>
								<tr>
									<td>【<?php echo $v['nav_order'];?>】</td>
									<td><strong width="240"><?php echo $this->v['nav_img']==""?"无":"<img src=".$this->v['nav_img'].">";?></strong></td>
									<td width="120"><?php echo $v['nav_name'];?></td>
									<td><?php echo $v['nav_url'];?></td>
									<td><a href="">编辑</a> | <a href="/admin/interface/del-navigation/id/<?php echo $v['id'];?>/type/<?php echo $v['nav_type'];?>" onclick="javascript:return confirm('您确认要删除此导航么？');">删除</a></td>
								</tr>
								<?php }?>
							</tbody>
							
							<tbody>
								<tr>
									<td><strong><a href="#" class="addnavigation">新增页头导航</a></strong></td>
								</tr>
							</tbody>
						</table>
					</div>
					
					
					<!-- 新增导航 -->
					<div id="navigation" title="新增导航">
						<div class="content">
							<table style="width: 100%;">
								<tr>
									<td colspan="2">
										<fieldset>
											<legend>新增导航</legend>
										</fieldset>
									</td>
								</tr>
								<tr>
									<td>
										<form action="/admin/interface/add-Navigation" method="post" id="addnavigationform" target="target_iframe">
											<p>
												<label for="input2">导航名称:</label><br>
												<input type="text" name="nav_name" value="" class="half title" id="nav_name">
											</p>
											
											<p>
												<label for="input2">导航url:</label><br>
												<input type="text" name="nav_url" value="" class="half title" id="nav_url">
											</p>
											
											<p>
												<label for="input2">导航排序: 升序排列方式 1，2，3</label><br>
												<input type="text" name="nav_order" value="" class="half title" id="nav_url">
											</p>
											
											<p>
												<label for="input2">导航打开方式:</label><br>
												<select name="nav_target" id="nav_target">
													<option value="">本页打开</option>
													<option value="_blank">新页面打开</option>
												</select>
											</p>

											<input type="hidden" name="image" value="" />
											<input type="hidden" name="nav_type" value="1" />
										</form>
									</td>
									<td width="140">
										<div class="cate_image">
											<img src="/topic_category_image/default/1.png" />
											<select>
												<option value="default/1.png">默认图片</option>
												<option value="0">自定义</option>
											</select>
											<form action="interface/addnavigation" target="target_iframe" method="POST" enctype="multipart/form-data">
												<input type="file" style="display: none;" name="nav_image" />
												<br />
												<a class="btn file" href="#"><span class="icon icon-add">&nbsp;</span>浏览</a>
												<a class="btn submit" href="#"><span class="icon icon-ok">&nbsp;</span>上传</a>
											</form>
										</div>
									</td>
								</tr>
							</table>
						</div>
					</div>
					

					<?php if($this->user_message['count'] > 0) { ?>
					<div class="width3 system_info">
						<h4>未读消息:</h4>
						<hr/>
						<table class="no-style full">
							<tbody>
								<?php foreach($this->user_message['data'] as $v) { ?>
								<tr>
									<td>
										<div class="content-box corners">
											<header style="cursor: s-resize;">
												<h3><img alt="" src="img/information.png"><?php echo $v['subject'] ?></h3>
											</header>
											<section style="width: 97%;">
												<p><?php echo $v['message'] ?></p>
												<table class="no-style full">
													<tbody>
														<tr>
															<td><b>来自</b></td>
															<td class="ta-right"><?php echo $v['msgfrom'] ?></td>
														</tr>
														<tr>
															<td><b>发送时间</b></td>
															<td class="ta-right"><?php echo date('Y-m-d H:i:s',$v['dateline']) ?></td>
														</tr>
														<tr>
															<td><b>操作</b></td>
															<td class="ta-right"><a href="<?php echo __PROJECTNAME__ ?>/admin/index/message-box" class="del_message">进入收件箱</a></td>
														</tr>
													</tbody>
												</table>
											</section>
										</div>
									</td>
								</tr>
								<?php } ?>
							</tbody>
						</table>
					</div>
					<?php } ?>
				</div>
			</section>
			<!-- End of right column/section -->
		</div>
		<!-- End of Wrapper -->
	</div>
	
	<link rel="stylesheet" type="text/css" href="css/start/jquery-ui-1.9.1.custom.min.css" media="all" />
	<script>
		var navigation = $('#navigation').dialog({
			modal: true,
			autoOpen: false,
			resizable: false,
			dialogClass:'navigation dialog',
			width: 450,
			buttons:[{
				text:'提交',
				click:function(){
					$('#navigation .content input[name=image]').val($('#navigation .content .nav_image>img').attr('src'));
					$('#navigation #addnavigationform').submit();
				}
			}]
		});
		
		$('.addnavigation').click(function(){
			$('#navigation .content .cate_image select option:first').attr('selected',true);
			$('#navigation .content .cate_image a.btn').hide();
			var img_path = $('#navigation .content .cate_image select option:first').attr('value');
			img_path = '/navigation_image/' + img_path;
			
			$('#navigation input[name=pid]').val($(this).attr('cid'));
			$('#navigation input[name=image]').val(img_path);
			$('#navigation input[name=t_cate_name]').val('');
			$('#navigation textarea[name=t_cate_desc]').val('');
			$('#navigation .content .nav_image>img').attr('src',img_path);
			
			$('#navigation #sampleform2').attr('action','interface/add-navigation');
			
			navigation.dialog('option','title',$(this).text());
			navigation.dialog('open');
			return false;
		});
		
	</script>
	<iframe src="" style="display: none;" id="target_iframe" name="target_iframe" frameborder="0"></iframe>
	
	<!-- End of Page content -->
<?php echo $this->render('inc/footer.htm') ?>